
package jass.iss.edu.Properties;
import java.io.IOException;
import java.util.Properties;

public class DepartmentDAO extends PropertiesDAO<DepartmentDTO> {



	public DepartmentDAO() throws IOException {
		super("Department.properties");

	}
	

	@Override
	protected DepartmentDTO read(Properties pProp, String pID) {
		DepartmentDTO Department = new DepartmentDTO(pID);			
		Department.setName(pProp.getProperty("Name"+pID));
		Department.setFunction(pProp.getProperty("Function"+pID));

		
		return Department;
	}


	@Override
	protected void write(Properties prop, DepartmentDTO dto) {
		String strID = dto.getId();
		prop.setProperty( "Name"+strID,  dto.getName());
		prop.setProperty( "Function"+strID,  dto.getFunction());


	}



}
